{block admin_content}
<h1>Role</h1>
<table width="100%">
	<thead>
		<tr><th width="20">Pořadí</th><th>Název</th><th width="20"><a n:href="addRole">Přidat</a></th></tr>
	</thead>
	<tbody>
		{foreach $roles as $role}
		<tr>
			<td>{$role[priority]}</td>
			<td>{$role[name]}</td>
			<td class="center"><a n:href="editRole, $role[id]"><img src="{$basePath}/images/edit.gif"></a> <a n:href="deleteRole!, $role[id]" onclick="return del();"><img src="{$basePath}/images/delete.gif"></a></td>
		</tr>
		{/foreach}
	</tbody>
</table>
<hr>
<h2>Oprávnění</h2>
{widget permissionForm}
<script type="text/javascript">
	$(function(){
		var height = $('fieldset:first').height();
		$('fieldset').height(10);
		$('fieldset table').hide();
		$('fieldset legend').css('cursor','pointer');
		$('fieldset legend').toggle(function(){
			$(this).parent('fieldset').animate({'height':height});
			$(this).parent('fieldset').children('table').show();
		}, function(){
			$(this).parent('fieldset').animate({'height':10},function(){
				$(this).children('table').hide();
			});
		});
	});
</script>
<script type="text/javascript">
function del(){
	return confirm('Opravdu chcete smazat roli?');
}
</script>
{/block}